<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$pagetitle}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-form-header">
            <div class="header-left" style="width:70%;">
                <div class="layui-inline">
                    <a class="layui-btn {if $Request.param.group_id==false}on{else/}layui-btn-primary{/if}" href="{:url('index')}">所有({$all_count})</a>
                    {foreach $member_group as $v}
                    <a class="layui-btn {if $Request.param.group_id==$v.group_id}on{else/}layui-btn-primary{/if}"
                       href="{:url('index',['group_id'=>$v['group_id']])}">{$v.name}({$v.count})</a>
                    {/foreach}
                </div>
                <div class="layui-inline">
                    <a class="layui-btn iframe" data-height="90%" data-width="70%" href="{:url('add')}">添加会员</a>

                </div>
            </div>

            <div class="header-right" style="width:30%">
                <form action="{:url()}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">门店</label>
                        <div class="layui-input-inline">
                            <input type="text" name="store_name" value="{$Request.param.store_name}" placeholder="" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">手机</label>
                        <div class="layui-input-inline">
                            <input type="text" name="phone" value="{$Request.param.phone}" placeholder="" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                        </button>
                    </div>
                </form>
            </div>

        </div>

        <div class="layui-card-body">
            <form class="layui-form"  lay-filter="component-form-element">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th width="3%">ID</th>
                        <th width="8%">门店名称</th>
                        <th width="10%">城市&地址</th>
                        <th width="5%">注册时间</th>
                        <th width="3%">联系人</th>
                        <th width="3%">手机号</th>
                        <th width="10%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach $data as $key=>$v}
                    <tr>
                        <td style="text-align: center;">{$v.id}</td>
                        <td style="text-align: left;">{$v.store_name}</td>
                        <td style="text-align: left;">{$v.province}-{$v.city}-{$v.area}<br>{$v.address}</td>
                        <td style="text-align: center;">{:date('Y-m-d H:i:s',$v.create_time)}</td>
                        <td style="text-align: center;">{$v.contact_name}</td>
                        <td style="text-align: center;">{$v.mobile}</td>

                        <td class="center">
                            <a href="{:url('detail',array('id'=>$v['id']))}" class="layui-btn layui-btn-sm iframe" data-height="600px">查看</a>
                            <a href="{:url('update',array('id'=>$v['id']))}" class="layui-btn layui-btn-sm iframe" data-height="90%" data-width="70%">编辑</a>
                            <a href="{:url('delete',array('id'=>$v['id']))}" class="layui-btn layui-btn-sm layui-btn-danger ajax_del" >删除</a>
                        </td>
                    </tr>

                    {/foreach}
                    </tbody>
                </table>
                <div class="listpage">{$paginate|raw}</div>
            </form>
        </div>

    </div>
</div>

<script src="/static/admin/layui/layui.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/globals.js"></script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'laydate'], function(){
        var laydate = layui.laydate;

        //示例代码

        //开始日期
        var insStart = laydate.render({
            elem: '#test-laydate-start'
            ,done: function(value, date){
                //更新结束日期的最小日期
                insEnd.config.min = lay.extend({}, date, {
                    month: date.month - 1
                });
                //自动弹出结束日期的选择器
                insEnd.config.elem[0].focus();
            }
        });

        //结束日期
        var insEnd = laydate.render({
            elem: '#test-laydate-end'
            ,min: 0
        });

    });
</script>

</body>
</html>
